<!DOCTYPE html>
<html lang="en" xmlns:th="http://www.thymeleaf.org">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script src="../static/js/jquery-1.8.2.min.js"></script>
    <link rel="stylesheet" href="../static/css/css.css">
</head>
<body>
<h1>添加页面</h1>
<form action="">
    用户名:<input type="text" name="userName"><br>
    密码:<input type="text" name="password"><br>
    真实姓名:<input type="text" name="trueName"><br>
    电子邮件:<input type="text" name="email"><br>
    联系电话:<input type="text" name="phone"><br>
    备注:<input type="text" name="comments"><br>
    冻结状态:<input type="text" name="lockState"><br>
    注册日期:<input type="text" name="registerDate"><br>
    性别:<input type="text" name="sex"><br>
    爱好:<input type="text" name="love"><br>
    <input type="button" th:onclick="add()" th:value="点击进行添加">
</form>
</body>
<script>
    function add() {
        $.post(
            "/basic/insert",
            $("form").serialize(),
            function (a) {
                if (a){
                    alert("添加成功")
                    location.href="/basic/select"
                }else{
                    alert("添加失败")
                }
            }
        )
    }
</script>
</html>